package it.traveldream.entities;

import it.traveldreamClient.beans.dto.ProdottoAcquistabileDTO;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.ManyToMany;

import org.eclipse.persistence.annotations.UuidGenerator;

@Entity
@UuidGenerator(name="products")
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public abstract class ProdottoAcquistabile implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY , generator="products")
	
	@Column(nullable = false)
	protected String idProdotto;
	
	@Column(updatable=true, nullable=false)
	protected Boolean Disponibilita = true;
	
	@Column(nullable = false)
	protected Integer Prezzo;
	
	/*@ManyToMany(mappedBy="acquistiCompiuti",fetch=FetchType.EAGER)
    private List<User> listaUtentiCompratori;*/
	
	public ProdottoAcquistabile (){
	
	}
	
	public ProdottoAcquistabile(ProdottoAcquistabileDTO dto) {
		
	}
	
	public Boolean getDisponibilita() {
		return Disponibilita;
	}
	public void setDisponibilita(Boolean disponibilita) {
		Disponibilita = disponibilita;
	}
	public Integer getPrezzo() {
		return Prezzo;
	}
	public void setPrezzo(Integer prezzo) {
		Prezzo = prezzo;
	}
	public String getIdProdotto() {
		return idProdotto;
	}
	
	
	public void setIdProdotto(String idProdotto) {
		this.idProdotto = idProdotto;
	}
	

	public abstract ProdottoAcquistabileDTO getDTO();
}
